Sparse neural control

ABSTRACT

Aspects herein describe new methods of determining optimal actions to achieve high-level goals with minimum total future cost. At least one high-level goal is inputted into a user device along with various observational data about the world, and a computational unit determines, though a method comprising backward and forward sweeps, an optimal course of action as well as emotions. In one embodiment a user inputs a high-level goal into a cell phone which senses observational data. The cell phone communicates with a server that provides instructions. The server determines an optimal course of action via the method of backward and forward sweeps, and the cell phone then displays the instructions and emotions to the user.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of U.S. application Ser. No. 14/595,479, filed Jan. 13, 2015, entitled “Particle Methods for Nonlinear Control,” which is a continuation of U.S. application Ser. No. 13/682,088, filed Nov. 20, 2012, and having the title “Particle Methods for Nonlinear Control”, which claims priority to provisional U.S. Application Ser. No. 61/621,712, filed Apr. 9, 2012, having the title “Particle Methods for Nonlinear Control in High Dimensions”, and to provisional U.S. Application Ser. No. 61/567,823, filed Dec. 7, 2011, having the title “Intelligent Devices”, each of which is herein incorporated by reference in its entirety for all purposes.

A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.

FIELD

Aspects described herein relate to computers, software, and artificial intelligence. More specifically, aspects relate to goal-oriented optimization for artificial intelligence systems.

BACKGROUND

Artificial intelligence is used to find non-obvious strategies and tactics to achieve high-level goals, while having limited ability to affect the world, and limited ability to observe the world. As a result, problem solving in robotics and similar disciplines usually involves control problems. Control problems usually have two parts, an estimation problem, which naturally runs forward in time, and a regulation problem, which naturally runs backwards in time.

Previously, no efficient solution to the fully nonlinear, high-dimensional control problem has been found, although partial solutions exist. Scientists in robotics have solved the nonlinear estimation problem using particle methods. For example, a particle filter with Monte Carlo estimation estimates Bayesian models by representing information, including ambiguity, as a probabilistic distribution. Other techniques have involved linearizing high-dimensional problems to achieve a solution more easily.

SUMMARY

The following presents a simplified summary of various aspects described herein. This summary is not an extensive overview, and is not intended to identify key or critical elements or to delineate the scope of the claims. The following summary merely presents some concepts in a simplified form as an introductory prelude to the more detailed description provided below.

In order to address the above shortcomings and additional benefits that will be realized upon reading the disclosure, aspects of illustrative aspects herein describe new particle methods which achieve high-level goals, while having limited ability to affect the world, and limited ability to observe the world.

Aspects described herein include a method of achieving goals while remaining uncertain about certain aspects of the environment. The described method may include receiving sensory information about a world along with high-level goals. The method may then determine probabilities of unknown states of the world and the cost of certain actions in order to achieve a goal for as little cost as possible. The action or set of actions which lead to the goal with as little cost as possible may be the optimal action or set of actions. The method may include a sparse network wherein a computational unit assigns most probabilities of unknown states of the world to zero. The computational unit may then perform backwards and forwards sweeps (e.g., by induction) in order to determine in what way the variables change over time in order to achieve the optimal action or set of actions.

The various aspects of the illustrative embodiments are substantially shown in and/or described in connection with at least one of the following figures, as set forth more completely in the claims.

These and other advantages, aspects, and novel features of the present disclosure, as well as details of illustrated embodiments, thereof, will be more fully understood from the following description and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete understanding of the present invention and the advantages thereof may be acquired by referring to the following description in consideration of the accompanying drawings, in which like reference numbers indicate like features, and wherein:

FIG. 1 depicts an illustrative network environment that may be utilized in accordance with various embodiments;

FIG. 2 illustrates an example user device that may be used in a network environment, such as either a client device or a server in the network environment of FIG. 1, in accordance with illustrative aspects described herein;

FIG. 3 illustrates a general view of interactions between a user device and a computational device during iterations of the method according to illustrative aspects described herein;

FIG. 4 illustrates an overview of steps of a sparse neural control method according to illustrative aspects described herein;

FIG. 5 illustrates steps of a backward sweep portion of a sparse neural control method according to illustrative aspects described herein;

FIG. 6 illustrates steps of a forward sweep portion of a sparse neural control method according to illustrative aspects described herein;

FIG. 7 illustrates an explanatory network for neural control system, telling a story via feed-forward from all observable information, according to one or more illustrative aspects described herein; and

FIG. 8 illustrates predictive network for neural control system, via feedback from stories, according to one or more illustrative aspects described herein.

DETAILED DESCRIPTION

I. Sparse Neural Control

Neural filtering has been proposed to be a form of iterated sparse factor analysis. Intelligence is more than passive filtering, however; it involves optimizing the feedback loop between inputs and actions—namely, solving the control theory (and more generally, game theory) problems.

To solve control theory, we place both motor intent and costs together, on equal footing with sensory input, as bottom-level inputs to the sparse factor analysis. The top-level sparse factor weights are then interpreted as probabilities of stories explaining the evolution of the state of the world. With this interpretation, we can apply techniques described in more detail below to solve the nonlinear control problem efficiently, with the additional benefit of the effective dimensional reduction provided by the sparse factor analysis.

By itself, sparseness cannot capture the invariance of concepts to important transformations such as perspective. Because network inputs from nearby times are most likely to consist of the same concepts but with transformed instantiations, we add the principle of stickiness to that of sparseness; that is, higher-level network outputs are trained to change with lower frequency. Representation theory shows that this requires additional network layers of so-called l²-pooling.

1. Concepts

Neural filtering has been proposed to be a form of iterated sparse factor analysis. Intelligence is more than passive filtering, however; it involves optimizing the feedback loop between inputs and actions. That is, it involves solving the control theory (and more generally, game theory) problems.

Unlike classical applications of neural networks to control theory that separately train a prediction network and a control network, however, we place both motor intent and costs together, on equal footing with sensory input, as bottom-level inputs to the sparse factor analysis (FIG. 7—Explanatory network for neural control system, telling a story via feed-forward from all observable information). The outputs of the sparse factor analysis are probabilities of different high-level explanations of the situation, which we will call stories.

Feeding a story back down the network by constraining the outputs, we can fill in missing future values of the inputs, and thereby predict how patterns of motor intent will create patterns of costs in different situations (FIG. 8—Predictive network for neural network control system, via feedback from stories). In this way, the sparse factor analysis provides a kind of dimensional reduction for the control problem: although the number of possible stories is large, making the nominal dimension of the output high, only a small fraction of the possible stories have non-zero weights in any situation, due to sparseness, making the effective dimension moderate. This allows us to apply techniques for solving nonlinear control problems that are effective in a moderate number of dimensions.

A variety of sparse network filters are available to achieve this dimensional reduction. For example, they can be based on neural networks, Boltzmann machines, or sparse coding, among others.

Finally, we need to capture the invariance of high-level concepts to transformations such as the translation of time and perspective transformations of space. Because network inputs from nearby times are most likely to consist of the same concepts but with transformed instantiations, we add the principle of stickiness; that is, higher-level network outputs are trained to change with lower frequency. The network must still be capable of representing transformation-invariant concepts. The natural way to support transformation invariance is via unitary representation theory, which leads to network architectures that have so-called l²-pooling layers after the factor analysis layers.

2. Neural Control

The type of network described above provides a way to update all of the variables of the control problem, combining both feed-forward and feedback in the network. The starting data is a prior distribution p_(t)(x) of the story x, the history of past and current sensory input y_(≤t) including the current input y_(t), the history of past motor intents u_(<t) and also a choice of current motor intent u_(t), and the history of past costs c_(<t). Let i_(t)=(y_(≤t), u_(<t), c_(<t)) denote the total history of observable information. The next predicted future sensory input y_(t+1) and the current cost c_(t) are unconstrained unknowns to be solved for; the other variables are used as best-fit constraints.

The result of applying the network is, first, by feed-forward (FF), a posterior distribution p_(t+1)(x) of the story x, and second, by feedback (FB), the history of past, current, and immediate future observable information i_(t+1) that best fits the story. That is, we have a map: p _(t(x)) ,i _(t) ,u _(t) →p _(t+1)(x),i _(t+1)=FF,FB

Note that this is something of an inversion of the usual control theory paradigm, where the observations y would be a function of the hidden state x; instead, here the explanatory story x is (in part) a function of the sensory input y. Nevertheless, we can still apply the methods for solving the nonlinear control problem described in more detail below.

To initialize the network, we may leave out the prior distribution p_(t) as a best-fit constraint. To act without thinking, based on already learned responses, we may leave out u_(t) as a best-fit constraint, and just predict it as part of i_(t+1) (call the resulting feedback FB′).

To solve the control theory problem, and learn how to respond to input, we apply the coupled forward-backward sweep method described in more detail in Section II, which solves the problem approximately in semi-local form. Thus for each future time t, we will compute a local cost function ƒ_(t)(x) of the story x, an uninformed probability distribution p_(t)(x) of the story, a most likely observable information, or archetype i_(t)(x) for the story, and an optimal control u_(t) (i) given the archetype i, so that the optimal expected cost will be approximated by the semi-local formulation: E _(p) _(t,i) [ƒ_(t)(x)]

where p_(t,i) is p_(t) restricted to stories x with the same archetype i=i_(t)(x) at time t.

The distinct archetypes form an implicit decision tree in forward time.

Both forward and backward induction rely on the network as follows: Starting with a specific story x_(t) from the current uninformed distribution p_(t)(x), the network as described above is applied with the prior p_(t) replaced by the delta distribution δ_(x) _(t) (x), the observable information replaced by the archetype i_(t)(x_(t)), and the current motor intent u_(t) replaced by the proposed optimal control u_(t)(i_(t)(x_(t))), to predict a current cost (c_(t)|x_(t))=FB^(c)(x_(t), u_(t)), a conditional posterior distribution p_(t+1)(x|x_(t))=FF(x_(t), u_(t))(x), and future archetype (i_(t+1)|x_(t))=FB(x_(t), u_(t)).

The backward step is then that the local cost function propagates as ƒ_(t)(x _(t) |u _(t))=(c _(t) |x _(t))+E _(p) _(t+1) _((x|x) _(t) ₎[ƒ_(t+1)(x)]=FB^(c)(x _(t) ,u _(t))+E _(FF(x) _(t) _(,u) _(t) _()(x))[ƒ_(t+1)(x)],

where u_(t) is chosen to optimize the expected cost min_(u) _(t) E _(p) _(t,i) _((x) _(t) ₎[ƒ_(t)(x _(t) |u _(t))]

Differentiating by u_(t), we find this happens where

u_(t) = (E_(p_(t), i_(t)(x_(t)))[FB_(u)^(c)(x_(t), u_(t))])⁻¹(−E_(p_(t,)i_(t)(x_(t)))E_(FF_(u)(x_(t), u_(t))(x))[f_(t + 1)(x)]).

Note that the derivative FF_(u)(x_(t), u_(t)) is a signed measure that effectively differentiates ƒ_(t+1)(x); in this sense the method is a kind of gradient descent of the cost. Since the space of motor controls u_(t) is typically much lower dimensional than the world, it is feasible to consider these partial derivatives. The previous equation is an iterative method to find u_(t); to initialize the iteration with a good initial guess, we can use the best already learned control FB′(x_(t))^(u) for that story. In addition, instead of computing the full gradient in u, which takes work dim u, we can instead perform the above descent in random u-directions, which takes unit work per step; this is just as effective for the same amount of work (so the number of steps to get equivalent accuracy goes up by a factor of dim u). Finally, to add creativity to intelligence, we can use a global instead of local optimization method, such as simulated annealing.

The forward step then produces the new posterior uninformed distribution p_(t+1)(x) as the convolution of p_(t)(x_(t)) with the p_(t+1)(x|x_(t))=FF(x_(t), u_(t))(x). Similarly, the future archetype i_(t+1)(x) is computed as the most likely future archetype (i_(t+1)|x_(t))=FB(x_(t), u_(t)) for x at time t+1, based on the probabilities FF(x_(t), u_(t))(x).

As described in more detail in Section II, it is easy to enhance this computation to simulate many common emotions as natural macroscopic statistics of the control problem.

3. Sticky Networks

By itself, sparseness cannot capture the invariance of concepts to important transformations such as the translation of time and affine transformations of space. One proposal to remedy this is convolutional networks, but this approach only handles translation invariance, and requires explicit imposition of the symmetry. Instead, because network inputs from nearby times are most likely to consist of the same concepts but with transformed instantiations, we propose to add the principle of stickiness to that of sparseness; that is, higher-level network outputs are trained to change with lower frequency.

But for stickiness to work, the network architecture must be capable of representing transformation-invariant concepts. To understand how to do this, the natural setting is representation theory. Suppose we have a group G of transformations acting on 2-dimensional space. Then G has a unitary representation on the linear space of 2-dimensional images L²(R²) by (gf)(x)=(det g)−^(1/2) ƒ(g⁻¹x). This representation splits orthogonally into irreducible unitary representations, and by unitarity, the l²-norms of the components of any image in these irreducible representations are individually invariant under the action of G, and constitute the maximal set of G-invariant concepts for these images.

The network architecture that can compute such invariants therefore consists of two distinct layers: (1) linear transformations that compute the irreducible components, followed by (2) computation of the l²-norm of each (multi-dimensional) component. The second step is called l²-pooling [5,6].

As an example, consider the oriented affine group Aff₂ ⁺(R)=GL₂ ⁺(R)

R².

The semi-direct decomposition of the group means we can accomplish our goal more conveniently with a four-layer network. The first pair of layers takes the magnitudes of the components of the Fourier transform of the inputs, which produces all translation invariants, in the form of another 2-dimensional image which still has an action of the linear group GL₂ ⁺(R) (the output is often called the power spectrum of the image). This GL₂ ⁺(R) action then decomposes using a second pair of layers into even and odd functions of each homogeneous degree of the form −1−iv, for all v∈R (these functions are just barely not square integrable at 0 and ∞). Each of these subspaces is an irreducible unitary representation of GL₂ ⁺(R), in fact it is the principal series representation with central character ± (even or odd) and pure imaginary infinitesimal character μ=iv, as can be seen explicitly by expressing it in the polar basis r^(−1−iv)e^(ikθ), for k∈2Z in the even case and k∈2Z+1 in the odd case (the raising and lowering operators of the representation increase and decrease k in steps of 2). If we are only interested in the conformal subgroup of Aff₂ ⁺(R), consisting of rigid motions and uniform scalings, the second pair of layers actually decomposes further into a 2-parameter set of complex scalar representations indexed by v∈R and k∈Z in the same polar basis.

4. Network Architecture

We now provide an example architecture for a sparse and sticky network with l²-pooling.

To begin, we use the structure of the already trained network. Each layer of the network will take an input vector y with ∥y∥=1, and provide a feedback vector y′ with ∥y′∥=1 and a feed-forward vector |x| (where x is a matrix and |x|_(i)=∥x_(i)∥) with ∥|x|∥=1 by minimizing the energy e=½∥y−y′∥ ²+½∥x−F·y′∥ ² +λ∥|x|∥ _(l) ₁

subject to the l² constraints that ∥y′∥=1 and ∥|x|∥=1, and the unitary constraint that F is of full rank and all its non-zero singular values are equal to 1. The l¹ penalty encourages sparseness of |x|, while the l² constraints ensure that y² and |x|² are probability measures.

Making the output be |x| instead of x is the l²-pooling step that allows the network to learn transformation-invariant concepts. Each F_(i) can in principle be trained to be a unitary representation of some transformation group G acting unitarily on the complexified inputs y, so that the output |x| is G-invariant. Note this requires each x_(i) to be a vector of real dimension at least two (i.e., complex dimension at least one), so that x is indeed a matrix as described above.

To run the network on a given input y, the energy can be minimized by constrained gradient descent; the gradients are ∇_(y′)(e)=(y′−y)+F ^(T)·(F·y′−x) ∇_(x)(e)=(x−F·y′)+λ sgn x

where (sgn x)_(i)=x_(i)/∥x_(i)∥. Although the unconstrained energy is convex, the l² constraints are non-convex, so there may be multiple local minima; we will choose the one reached by descent from the initial condition y′=y, x=F·y. The constraints are applied by l²-normalizing y′ and x after each step.

To train the network naively, we optimize the tensor F by minimizing the average E=Σ_(t) w_(t)e_(t) of these energies across many training examples. To perform this training in an on-line manner, since the gradient of this summed energy is the sum of the individual gradients, we can take a single gradient step of each individual energy as we encounter the corresponding training example. The individual gradient with respect to F is ∇_(F)(e)=(F·y′−x)⊗y′.

The unitary constraint on F is applied by replacing F by |F|⁻¹F after each step, where |F|=(FF^(T))^(1/2).

The problem with this naïve training is that it has no incentive to learn invariant concepts, in fact doesn't even know what group its outputs should be invariant to. The solution is to apply the principle of stickiness, which says that network inputs from nearby times should produce similar outputs, because those inputs most likely represent transformed instantiations of the same concepts. To impose stickiness, we add a non-convex penalty term to the energy for each time: e _(t)=½∥y _(t) −y _(t)′∥² ∥x _(t) −F·y _(t)′∥² +λμ∥|x _(t) |−|x _(t−1)|∥_(l) ₁ +λ∥|x _(t)|∥_(l) ₁ ,

with μ≤1. The choice of l¹ penalty is to produce stories that tend to be constant locally in time with occasional jumps. With this additional term, the training x-gradient becomes: ∇_(x) _(t) (E)=(x _(t) −F·y _(t)′)+λ(1+μ sgn(|x _(t) |−|x _(t−1)|))sgn x.

II. Solution of Nonlinear Control Problems

1. Regulation

We will build our way to the full control problem in steps. To model the pure regulation problem with no estimation, we define deterministic but fully nonlinear dynamics {dot over (x)}=a(t,x,u) {dot over (v)}=c(t,x,u);

where x is the state variable, u is the control variable, and v is the scalar cost. We assume c≥0, c_(uu)>0 to make the problem nondegenerate. The objective is to choose u to minimize the future cost v(T)−v(t) from the current time t up to some possibly infinite time horizon T.

Let ƒ(t, x(t)) be this minimum future cost, which depends only on the current state x(t). Then the fact that we have the freedom to wait to optimize u(t) until time t arrives means that we obtain a backward recursion ƒ(t,x(t))=min_(u(t))[(v(t+dt)−v(t))+ƒ(t+dt,x(t+dt))]

and so subtracting the left side from both sides, we obtain 0=min_(u(t))[c(t,x(t),u(t))+ƒ_(u)(t,x(t))a(t,x(t),u(t))+ƒ(t,x(t))]

Differentiating by u, and using the assumption that c_(u)>0, we can see this minimum is attained where u=c _(u) ⁻¹(t,x,−ƒ _(x)(t,x)a _(u)(t,x,u)).

The fact that the minimum is zero then gives an evolution equation for f backward in time from T when it is known. This is the well-known Hamilton-Jacobi-Bellman equation: −{dot over (ƒ)}(t,x)=c(t,x,u)+ƒ_(u)(t,x)a(t,x,u);

where u is chosen by the previous control equation. The optimal control may not be unique. At such option points, the optimal control u varies discontinuously in x, so that slightly different x yield very different u. The solution ƒ will be continuous there, but will have a kink.

In low dimensions, this first-order partial differential equation can be numerically solved on a grid by an Eulerian method, with numerics paying attention to the direction of characteristics. Where characteristics collide at option points, we must impose an entropy condition to choose the lowest value of ƒ. At each point, the control equation can be applied iteratively to solve for u, averaging the right side with enough of the current guess for stability, if necessary. This Eulerian approach to Hamilton-Jacobi type equations has been extensively studied.

In high dimensions, we can solve the equation with a Lagrangian particle method that follows characteristics directly. The result is reverse time dynamics of particles with state (x, ƒ, u) of the form

${- \overset{.}{x}} = {{{- {a\left( {t,x,u} \right)}} - \overset{.}{f}} = {c\left( {t,x,u} \right)}}$ ${u = {c_{u}^{- 1}\left( {t,x,{{- {a_{u}\left( {t,x,u} \right)}}\frac{\partial f}{\partial x}}} \right)}},$

where the gradient ∂ƒ/∂x is effectively a particle interaction term. In contrast to previous work on Lagrangian methods for Hamilton-Jacobi-Bellman equations, we accomplish this interaction without any additional explicit nearest-neighbor structure on the particles, by treating the computation of the gradient as locally weighted linear regression problem. In Section 7, we will explore special consideration for this regression in very high dimensions.

Under these reverse time dynamics, particles will tend to be repelled from optimal control paths to fill out the basin of attraction within which the dynamics can be brought under control. Conversely, particles will tend to be attracted to option points, defining the multiple equally good futures that could arise from those points. The combination of these effects tends to make the particle density highly non-uniform as reverse time increases. For this reason, it is numerically necessary to periodically resample the particles. See Section 8 for sampling considerations.

The entropy condition in this particle formulation corresponds to a rule for particle collisions. Since, with a discrete set of particles, it is difficult to detect collisions that might have occurred with a full set of particles, we can impose the entropy condition approximately by introducing a small amount of viscosity, locally averaging the f-values. This can be accomplished with the same local linear regression used to compute the gradient ∂ƒ/∂x. In the following section, we will show how this averaging should be quantitatively controlled to correspond to a specific noise term added to the original deterministic dynamics.

2. Noisy Regulation

To model just the addition of noise to the original deterministic regulation problem, we define stochastic but fully observable dynamics dx=a(t,x,u)dt+s(t,x)dB dv=c(t,x,u)dt;

where x is the state variable, u is the control variable, v is the scalar cost, and dB is a Brownian motion. We assume c≥0, c_(uu)>0, and s²>0 to make the problem nondegenerate. The objective is to choose u to minimize the expectation of the future cost v(T)−v(t) from the current time t up to some possibly infinite time horizon T.

Let ƒ(t, x(t)) be this minimum future cost, which depends only on the current state x(t). Then the fact that we have the freedom to wait to optimize u(t) until time t arrives means that we obtain a backward recursion ƒ(t,x(t))=min_(u(t)) E[v(t+dt)−v(t))+ƒ(t+dt,x(t+dt))]=min_(u(t)) E _(dB)[c(t,x(t),u(t))dt+ƒ(t+dt,x(t)+a(t,x(t),u(t))dt+s(t,x(t))dB]

and so subtracting the left side from both sides, we obtain 0=min_(u)[c+{dot over (ƒ)}+ƒ _(x) a+½ƒ_(xx) ²]

Differentiating by u, and using the assumption that c_(uu)>0, this minimum is attained, as in the deterministic case, where u=c _(u) ⁻¹(−ƒ_(x) a _(u)).

The fact that the minimum is zero then gives an evolution equation for f backward in time from T when it is known. This is a modification of the Hamilton-Jacobi-Bellman equation by an additional viscosity term: −{dot over (ƒ)}=c+ƒ _(x) a+½ƒ_(xx) s ²,

where u is chosen by the control equation. The special case where a is linear in u and c is quadratic in u has been studied, and efficient linear methods of solution have been found even for high-dimensional problems.

Before explaining a particle method for solution of this problem, let us consider how to use particles to approximate the diffusion term ½ƒ_(xx)s². At x, this term averages values ƒ(x′) against the normal probability measure n(x, s² dt)(x′)Dx′ where Dx′ is the uniform measure in x′, and n(μ, σ²) is the normal density function. For a particle method, it will be sufficient to approximate Dx′ in measure by a sum of delta measures at particle locations. Suppose that particles with locations x′ and delta weights q′ are given at time t, and that they form a good approximation of the uniform measure at t. Then if we flow the particles from t to t+dt along the deterministic dynamics, the log of the volume of a bundle of particles near x′ increases at a rate equal to the divergence of a at x′. This means that for the evolved set of particles and weights to remain an approximation to the uniform measure, log q′ must also increase at a rate equal to the divergence of a at x′. If we flow the weights q′ according to this rule, then the effect of the diffusion term at x is to take a weighted average of values ƒ(x′) with weights q′ n(x, s² dt)(x′) over all particles (x′, q′).

This problem can therefore be solved using particles having state (x, ƒ, q, u), where q is the uniform weight of the particle. The reverse time dynamics are the same as in the deterministic case within each time step, with the addition of the dynamics of the uniform weights:

${- {dx}} = {{{{- {a\left( {t,x,u} \right)}}{dt}} - {df}} = {{{{c\left( {t,x,u} \right)}{dt}} - {d\;\log\; q}} = {- {{tr}\left( {{\left( {{a_{x}\left( {t,x,u} \right)} + {{a_{u}\left( {t,x,u} \right)}\frac{\partial u}{\partial x}}} \right){dt}u} = {{c_{u}^{- 1}\left( {t,x,{{- {a_{u}\left( {t,x,u} \right)}}\frac{\partial f}{\partial x}}} \right)}.}} \right.}}}}$

However, to match the diffuse on term we must—following the backward evolution step and prior to computing the new control—replace f at x with the weighted average of ƒ′, with weights q′ n(x, s² dt)(x′), over all nearby particles (x′, ƒ′, q′, u′). Given that we must also compute the gradient of ∂ƒ=∂x for the control equation by particle interaction, a convenient way to combine the two steps is to interact the particles near x by weighted linear regression of ƒ′ against x′, with weights q′ n(x, s2 dt) (x′), over all nearby particles (x′, ƒ′, q′, u′). The intercept of the regression will then serve as the new ƒ value at x, and the slope of the regression will serve as the gradient ∂ƒ/∂x for the calculation of the new u value in the control equation. Similarly, following the computation of the new control u, we must update the value of ∂u/∂x for use in the next evolution step of q by regressing u against x. As before, periodic resampling of the particles is numerically useful.

Numerical stability of this method requires that the particle spacing be small enough and the time step be properly controlled. To avoid degenerate regression (where only one particle has numerically non-zero weight), the noise cannot be too much smaller than the particle spacing; that is, s√{square root over (Δt)}≥ϵΔx, where ϵ is not too small. To avoid characteristics crossing each other within the time step, we must have (∇·a)(Δt)≤1. Together, this means that the optimum settings are

${\Delta\; x} \sim \frac{s}{\sqrt{{\nabla{\cdot a}}}}$ and ${\Delta\; t} \sim {\frac{1}{{\nabla{\cdot a}}}.}$ In practice, we must do the best we can with a limited number of particles and a uniform time step for all particles. The best time step we can take is then

${\Delta\; t} \sim {\frac{1}{\max{{\nabla{\cdot a}}}}.}$ The particles should be sampled with an un-normalized density r chosen to best capture the features of the dynamics. In particular, we can best capture codimension one features of the dynamics by making the un-normalized particle density r∝|∇·a|

so that particles uniformly sample the values of a in the direction perpendicular to a rapid change in the dynamics. Note that despite the varying particle density, the resulting local particle spacing

${\Delta\; x} \propto r^{{1/\dim}\; x} \propto \frac{1}{{{\nabla{\cdot a}}}^{{1/\dim}\; x}}$ does not vary dramatically in very high dimensions. Finally, to maintain stability, we must then invert the previous equations to increase the noise to

$s = {\epsilon\frac{\Delta\; x}{\sqrt{\Delta\; t}}}$ as a function of the best Δt and Δx achievable. Section 8 provides an algorithm for sampling particles according to an arbitrary un-normalized sampling density r.

3. The Logic of Control

To model the purely logical part of the full control problem, we now add hidden state while keeping deterministic dynamics: {dot over (x)}=a(t,x,u) {dot over (y)}=b(t,x,u) {dot over (v)}=c(t,y,u)

where x is the hidden state variable, y=m(x) is the observed measurement variable, u is the control variable, and v is the observable scalar cost. We assume c≥0 and c_(uu)>0 to make the problem nondegenerate. Evidently, b=m_(x)a. We are given a prior probability distribution p(0) of the hidden state x (which must project to a single observation y(0)). We also impose a terminal cost g(y)≥0 at some possibly infinite time horizon T. The objective is to choose u to minimize the expectation of the future cost v(T)−v(t)+g(y(T)) from the current time t up to the time horizon T, given that we can only observe y and not x.

The state of the observer at any time t is defined by an unnormalized probability distribution p(t)(x(t)) of the hidden state x(t) which projects to a single observation y(t). Therefore the minimum expected future cost can be defined by a functional ƒ(t, p(t)) of this state. This functional has the terminal boundary condition ƒ(T,p(T))=g(y(T)).

The fact that we have the freedom to wait to optimize u(t) until time t arrives means that we obtain a recursion for f backward in time: ƒ(t,p(t))=min_(u(t)) E[c(t,y(t),u(t))dt+ƒ(t+d,p(t+dt))|p(t),u(t)]

Thus, in principle, we can compute ƒ(0, p(0)) as desired. The apparent difficulty, however, is that ƒ is not just a function, but a functional of a probability distribution, making the dimensionality of the problem exponentially greater. Previous attempts to solve the general control problem have not addressed this key barrier to practical solutions.

To attack this difficulty, we first show we can write this functional in the semi-local form ƒ(t,p(t))=E _(p(t))[ƒ(t,p(t),x(t))],

with the aim of turning it into as local a formulation as possible. At the terminal time T we can use a constant function ƒ(T, p(T), x(T))=g(y(T)). At times t when no observational information is revealed, p(t+dt) is deterministically evolved as a measure from p(t) by the forward dynamics of x. According to the recursion, the function ƒ(t, p(t), x(t)) can then also be evolved from ƒ(t+dt, p(t+dt), x(t+dt)) as a function by reverse dynamics of x, plus addition of the constant c(y(t))dt to the values. At times t when observational information is revealed, p=p(t) breaks up by restriction into unnormalized distributions p_(i) corresponding to the distinct observations y(t) that could result. If ƒ_(i)(x)=ƒ(t, p_(i), x) are the corresponding functions, then the recursion shows that the functions simply glue together as ƒ=ƒ_(i) corresponding to the distinct observations. Over time, the index i will represent precisely the path y(0), . . . , y(t) of observations. This proves the semi-local form by induction, and shows furthermore that the combined unnormalized probability density p(x) simply propagates forwards as a measure by forward dynamics of x, and that the combined cost function ƒ(x) propagates backwards as a function by reverse dynamics of x but also increases at the rate c(y).

In this semi-local formulation, the only part that remains global is the grouping of the x that determines which optimal control u is used for the reverse dynamics of the function ƒ(x) and forward dynamics of the density p(x), with more clumping of x as we progress backwards in time. If we allow ourselves to add a small amount of noise to the control u, then the grouping becomes independent of u, because we can distinguish x not only based on distinct values of b, but also distinct values of b_(u). In summary, we have the almost purely local reverse time dynamics for ƒ −{dot over (ƒ)}=c+ƒ _(x) a;

where the only global part is that the control u is chosen so that 0=c _(u) +E _(p) _(i) [ƒ_(x) a _(u)].

with the expectation taken over points that are grouped together by the same observation path index i (with the grouping independent of u). Similarly, we have almost purely local forward time dynamics for p {dot over (p)}=−p _(x) a−ptr(a _(x) +a _(u) u _(x));

where the only global part is again the choice of control u.

This naturally suggests a particle method, with alternate backward and forward sweeps. The particles have state (x, y, ƒ, p, u, i), where p is the unnormalized weight, and i is the observation path index. In the backward sweep, we take p and i as given, and particles have interacting reverse time dynamics

${{- \overset{.}{x}} = {{{- {a\left( {t,x,u} \right)}} - \overset{.}{y}} = {{{- {b\left( {t,x,u} \right)}} - \overset{.}{f}} = {{{c\left( {t,x,u} \right)}u} = {c_{u}^{- 1}\left( {t,y,{- {E_{p_{i}}\left\lbrack {{a_{u}\left( {t,x,u} \right)}\frac{\partial f}{\partial x}} \right\rbrack}}} \right)}}}}},$

where the expectation E_(p) _(i) is the weighted average taken over particles with the same observation path index i. The gradient ∂ƒ/∂x is computed by interaction of nearby particles without regard to grouping.

In the forward sweep, the weights p are corrected and propagated forward as constants along the particle trajectory, and the observation path indices i are propagated forward and split based on observational information that is revealed.

Previous work attempting to apply particle methods to modeling the uncertainty p(t) in nonlinear control problems only optimizes a single control path u(t) over all particles generated from the initial uncertainty p(0). This does not allow for the fact that we can wait to optimize u(t) until time t, by which time more information may have been revealed. Their suboptimal solution can be obtained in our algorithm by fixing the grouping to have a single group for all particles for all time.

4. Control

The full control problem has hidden state and stochastic dynamics: dx=a(t,x,u)dt+s(t,x)dB dy=b(t,x,u)dt+r(t,x)dB dv=c(t,y,u)dt

where x is the hidden state variable, y=m(x) is the observed measurement variable, u is the control variable, v is the observed scalar cost, and dB is a Brownian motion. By Ito's Lemma, we have b=m_(x)a+½m_(xx)s² and r=m_(x)s. We assume c≥0, c_(uu)>0, and s²>0 to make the problem nondegenerate. We are given a prior probability distribution p(0) of the hidden state x (which must project to a single observation y(0)). We also impose a terminal cost g(y)≥0 at some possibly infinite time horizon T. The objective is to choose u to minimize the expectation of the future cost v(T)−v(t)+g(y(T)) from the current time t up to the time horizon T, given that we can only observe y and not x.

Note that because we are including the measurement mechanism y as part of the system x, measurement noise is naturally included as part of the system noise. Also, note that although the noise is infinitesimally normally distributed, the fact that the coefficients of the Brownian motion depend on state means that the noise need not be normally distributed over infinite time intervals.

The state of the observer at any time t is defined by a probability distribution p(t)(x(t)) of the unobserved state x(t), which projects to a single observation y(t). Therefore the minimum expected future cost can be defined by a functional ƒ(t, p(t)) of the state. This functional has the terminal boundary condition ƒ(T,p(T))=g(y(T)).

The fact that we have the freedom to wait to optimize u(t) until time t arrives means that we obtain a recursion for ƒ backward in time: ƒ(t,p(t))=min_(u(t)) E[c(t,y(t),u(t))dt+ƒ(t+d,p(t+dt))|p(t),u(t)].

Again, this provides a solution in principle, but is not practical because ƒ is a functional of a probability distribution p.

As before, we will try a semi-local formulation ƒ(t,p(t))=E _(p(t))[ƒ(t,p(t),x(t))],

with the aim of turning it into as local a formulation as possible.

Let p(t, x(t)) be the “uninformed” distribution, evolved from p(0) purely by the local, noisy dynamics without using the information about the observations y(0), . . . , y(t). Initially, p(0, x) projects to a single observation y(0). If at some later time, multiple observations y have non-zero probability, then conditional on the actual observation y(t), we can obtain information that allows us to restrict the “informed” distribution p(t) to the part of p(t, x) that projects to y(t).

In the previous section, without any noise, such restricted distributions did not recombine, so we obtained finer and finer restrictions of p(t, x) over time. With noise, we can locally have different observations in one time step and identical observations in the next time step, without any information being revealed. More precisely, the probability distribution of x conditional on noisy observations does not depend on the history of the noise, only on the final observation. The overall probability contributed by any particular history with the same final observation follows a normal distribution, so that the most likely path in retrospect is the deterministic one. Thus locally, the informed distribution is just the restriction of the uninformed distribution to the current observation y(t).

Globally, informed distributions could overlap in this noisy case, but we will make the approximation that each value of the uninformed distribution belongs to the most likely informed distribution. The way to accomplish this, which also works locally, is to assign an index i to each point x; the informed distribution p_(i) will be the uninformed one restricted to the index i. During the time step, we diffuse i, and let the preliminary new value of i be the most likely index under the diffusion. Finally, we append the information about the new observation y(t) to this preliminary index i. In summary, the index i represents the most likely observation path to the current observation y(t).

We will now show by induction that, given the previous approximation for p(t), it is self-consistent to use a single cost function ƒ(t, x(t)). This is true by assumption at the final time T. Expressing the backward recursion in terms of a single cost function (at t+dt by induction, and at t to check whether it can be done self-consistently), we find

$\begin{matrix} {{E_{x{(t)}}\left\lbrack {f\left( {t,{x(t)}} \right)} \right\rbrack} = {{\min_{u{(t)}}{E_{y{({t + {dt}})}}{c\left\lbrack {t,{y(t)},{u(t)}} \right)}{dt}}} + E_{{x{({t + {dt}})}}❘{y{({t + {dt}})}}}}} \\ \left. \left\lbrack {f\left( {{t + {dt}},{x\left( {t + {dt}} \right)}} \right)} \right\rbrack \right\rbrack \\ {\left. {= {\min_{u{(t)}}\left\lbrack {{E_{x{(t)}}{c\left( {t,{y(t)},{u(t)}} \right)}},{{dt} + {E_{dB}\left\lbrack {{{f(t)} + {dt}},{x + {{a\left( {t,{x(t)},{u(t)}} \right)}{dt}} + {{s\left( {t,{x(t)}} \right)}{dB}}}} \right)}}} \right\rbrack}} \right\rbrack.} \end{matrix}$

Subtracting the left side from both side, we obtain the equation 0=min_(u) E _(p) _(i) [c+{dot over (ƒ)}+ƒ _(x) a+½ƒ_(xx) s ²].

The minimum is obtained where the following global condition holds: 0=c _(u) +E _(p) _(i) ƒ_(x) a _(u),

where E_(p) _(i) is the expectation over the “informed” distribution. Using that optimal control (uniquely defined because the p_(i) are disjoint), it is self-consistent to use otherwise purely local backward dynamics for ƒ(x): −{dot over (ƒ)}=c+ƒ _(x) a+½ƒ_(xx) s ².

The “uninformed” local density p(x) can only evolve forward in time because the diffusion of x is an irreversible operation. The forward evolution of p(x) is purely local except for the global choice of control u, and combines the motion of a measure under the deterministic part of the dynamics of x with a term for the diffusion: {dot over (p)}=−p _(x) a−ptr(a _(x))+½p _(xx) s ².

Putting together the work of the previous sections, this naturally corresponds to a particle method, with alternate backward and forward sweeps. The particles have state (x, y, ƒ, p, q, u, i), where p is the unnormalized weight, q is the uniform weight, and i is the most likely observation path index. In the backward sweep, we take p and i as given, and then particles have interacting reverse time dynamics

${- {dx}} = {{{{- {a\left( {t,x,u} \right)}}{dt}} - {dy}} = {{{{- {b\left( {t,x,u} \right)}}{dt}} - {df}} = {{{{c\left( {t,y,u} \right)}{dt}} - {d\;\log\; q}} = {{- {{tr}\left( {{a_{x}\left( {t;x;u} \right)} + {{a_{u}\left( {t,x,u} \right)}\frac{\partial u}{\partial x}}} \right)}}{dt}}}}}$ $u = {c_{u}^{- 1}{\left( {t,y,{- {E_{p_{i}}\left\lbrack {{a_{u}\left( {t,x,u} \right)}\frac{\partial f}{\partial x}} \right\rbrack}}} \right).}}$

After each backward time step, but before application of the control equation to find the new control, the particles near x interact by weighted linear regression of ƒ′ against x′, with weights q′ n(x, s² dt)(x′), over all nearby particles (x′, y′, ƒ′, p′, q′, u′, i′). The intercept of the regression will then serve as the new ƒ value at x, and the slope of the regression will serve as the gradient ∂ƒ/∂x for the calculation of the new u value in the control equation. Similarly, following the computation of the new control u, we must update the value of ∂u/∂x for use in the next evolution step of q by regressing u against x. To compute the expectation E_(p) _(i) with respect to the “informed” distribution, because we may not have a good sample of particles for p_(i) even with a good sample of particles for p, we must interpolate from nearby observation path indices i′. It is numerically useful to resample the particles periodically. See Section 8 for the sampling density and sampling algorithm.

In the forward sweep, we take x, y, ƒ, q, and u as given. The weights p are initialized to the original uncertainties, and the indices i are all set to the one-point path (y(0)). They then evolve forward according to dp=0, i.=y,

where .=indicates appending a value to a path. After each forward step, the particles near x interact by averaging values of p′, with weights q′ n(x, s² dt)(x′), and extracting most probable values of with weights p′ q′ n(x, s² dt)(x′), over all nearby particles (x′, y′, ƒ′, p′, q′, u′, i′).

5. Games

So far we have assumed that the state dynamics, while possibly time dependent, are explicitly known. The simplest way this can fail is if there are unknown parameters in our model of the world. But such parameters can simply be included in the state variables and given zero dynamics. Given a prior p(0), Bayes' Rule will then update our knowledge of them. To obtain the prior p(0), particle learning methods have been developed that make the most efficient use of Bayes' Rule for parameter estimation using a particle approximation.

More seriously, so far we have avoided the social question that we may not be the only optimizer in the world. If there are other actors in the world optimizing back in response to our actions, to predict future costs we have to jointly optimize ourselves and the other actors. Game theory studies precisely these joint optimization questions. However, this approach leads to two important paradoxes we must resolve.

The first paradox is suboptimality. As the classic Prisoner's Dilemma game shows, when joint optimization is achieved by each actor individually optimizing its own costs, suboptimal solutions are often reached, in the sense that there are possible outcomes which would be strictly better for every actor, but are not individually optimal. Given that humans are usually able to reach better solutions through cooperation, there has been recent interest in understanding the game-theoretic basis for this success. The only mathematical loophole in the Prisoner's Dilemma is that if the two actors play not just one, but an indefinitely long sequence of Prisoner's Dilemma games (with probability of playing again sufficiently high), then cooperation becomes an individually optimal solution because the other actor can always impose future punishment for current non-cooperation. This leads to a social solution to the paradox: communication between social actors can effectively turn individual games with specific actors into an indefinitely long sequence of games with society as a whole, with punishment coordinated within society via communication. For our purposes, it is enough to know that in the case of finite terminal times T<1, we should construct the terminal cost function differently from the incremental cost function, so that states that are mutually optimal in the incremental cost are also individually optimal in the terminal cost. The backward sweep will then propagate cooperation backward from there.

The second paradox is recursive rationality. If the state of the world that we try to discover includes another actor's prior, with the other actor's dynamics defined by optimal actions based on that prior, then our prior must actually be a meta-distribution over possible priors of this actor. But then this actor's prior must similarly be a meta-distribution, meaning that our prior must be a meta-meta-distribution, and so on. This recursive assumption is called Common Knowledge of Rationality (CKR). Clearly, CKR is computationally intractable. Fortunately, CKR has also been shown to be self-contradictory. Humans do think somewhat recursively about what other humans think about what they're thinking, but not to an unlimited depth. For our purposes, we can support limited recursion by including all of the (finitely many) parameters of our “mental model” of other actors, and others' mental model of us, in the state of the world. We may then have a prior over this state, but other actors are not allowed to recursively think about this prior; similarly, other actors may then have a prior over this state, but we are not allowed to recursively think about this prior.

The game problem therefore looks formally similar to the control problem: dx=a(t,x,u)dt+s(t,x)dB dy=b(t,x,u)dt+r(t,x)dB dv=c(t,y,u)dt

except that now v is a vector of costs, one for each actor, u is a matrix of control vectors per actor, and y is a matrix of observation vectors per actor. We assume that one actor's controls do not directly cost any other actor, so that off-diagonal blocks of c_(u) are zero. As initial conditions, we are given a vector of priors p(0) for all of the actors. We also impose a vector of terminal costs g(y) for all actors (as explained above, this should be a forward-looking cost that bakes in future punishment). The objective is to simultaneously minimize all of the expectations of the future costs v(T)−v(t)+g(y(T)) from the current time up to the time horizon T, given that each actor can only observe its own part of y. With proper matrix interpretation, most of the mathematics of the game problem is the same as for the control problem, except that due to individual optimization, we must replace the control equation with diag(c _(u) +E _(p) _(i) [ƒ_(x) a _(u)])=0.

6. Emotions

Emotions are a means for communicating important statistics about the individual's control problem to the body, and in social animals, also to other individuals. For example, fear is an emotion that communicates uncertainty about a possible bad outcome of the individual's control problem. The purpose of communicating the fear emotion to the body is to trigger adrenaline, which allows more rapid response in the face of uncertainty. The purpose of communicating it to other individuals via the stereotypical facial expression of fear is to allow the other individuals to raise their awareness as well.

Expectation of future pleasure creates happiness and of future pain creates sadness. The statistic that quantities this is the expectation of v(T) relative to v(t); a low expectation results in a happy emotion, while high expectation results in a sad emotion. This relative expectation is exactly ƒ(t), which we already compute.

Uncertainty about future outcomes creates tension, which is experienced as fear for unhappy tension and excitement for happy tension. The statistic that quantifies this is the variance of v(T); a high variance results in a fear emotion during experience of the sad emotion, and results in an excitement emotion during experience of the happy emotion. Otherwise, low variance results in a calm emotion. To compute the variance of v(T), let ƒ₂ (t) denote the expectation of (v(T)−v(t))². Then the variance of v(T) is given by ƒ₂(t)−ƒ²(t), and ƒ₂(t) can be computed in terms of a local square cost function ƒ₂(t, x) as ƒ₂ (t)=E_(p(t))[ƒ₂(t,x)]. The local square cost function can in turn be computed by backward induction as −{dot over (ƒ)}₂=2cƒ+(ƒ₂)_(x) a+½(ƒ₂)_(xx) s ².

So far we have described emotions that are statistics of the backward sweep, but there are forward emotions as well. Observations that have relatively low probability according to the individual's prior knowledge p create surprise. Sad surprise results in a frightened emotion, while happy surprise results in a funny emotion.

7. Particle Interaction

To approximate the interaction term ∂ƒ/∂x in very high dimensions, where the dimension could exceed the number of particles, we need to make use of the geometric structure of the set of dimensions N. For example, if the dimensions represent values of a physical field in one spatial dimension, the geometry of the set of dimensions is a line. Alternatively, if the dimensions have discrete relationships (such as a hierarchical classification), the geometry of the set of dimensions can be represented by a graph (a tree in the case of pure hierarchy).

The least presumptive gradient m is the one with the least geometric information when considered as a function on N, where geometric information is measured by the total variation energy

${m}_{TV} = {\int_{N}^{\;}{\left. \frac{\partial m}{\partial n} \right\rceil\ {{Dn}.}}}$

This energy totals up the size of a boundary between different values of the function times the absolute change in the value across that boundary. The definition can be applied to discrete geometries such as graphs, as well as continuous geometries.

Let m be our estimate of the augmented gradient, considered either as vector or as a function on N, as appropriate. (Augmented means there is an extra coordinate to account for the constant term in the regression.) Further let F be the vector of ƒ values for the particles, and X the matrix whose rows are the augmented x values for the particles. Then we apply weighted linear regression with a total variation penalty, minimizing the convex function |F−Xm| ² +λ|m| _(TV).

Here |⋅| is the weighted l² vector norm with particle weights chosen to regress only against nearby particles, as prescribed by the previous sections.

In very high dimensions, where the number of dimensions is greater than the number of particles, this optimization is not strictly convex, and so the essentially unique minimum may actually be a convex set of minima. For an iterative optimizer, the choice of minimum will then depend on the initial guess. When used as part of the timestepping methods presented above, the initial guess should be the result from the previous time step, for stability.

8. Particle Sampling

If the system is smooth and slowly varying, uniform sampling of particles with uniform weights may be appropriate. However, if the system has features—places where the system varies rapidly or discontinuously—uniform sampling may miss them. In this case, as is typical in Monte Carlo methods, we must employ importance sampling. In this technique, we sample particles more densely near features, but lower their uniform weights q proportionally, so that the entire set of weighted particles still approximates the uniform distribution. As explained in Section 2, to capture features of codimension one, we need a sampling density proportional to the local rate of change of the dynamics. Similarly, we care most about particles with high observational probability p; we also want to apply importance sampling to sample more densely in regions of high p.

Given a desired un-normalized sampling density r(x), we could in principle use the standard Metropolis algorithm to generate a sample of particles at each time step. This is very expensive, however, because that algorithm generates autocorrelated samples, and so we must discard most of its output. Fortunately, because at each time step we already have an approximate sample, perturbed only by the local dynamics of the system, we can use a dynamic Metropolis algorithm that starts with a given approximate sample and in a few steps produces from it a better one with approximately the same number of particles. The key is that we don't care if individual particles are correlated between time steps.

The way the dynamic Metropolis algorithm works is that for each original particle x_(b) we draw a symmetric jump to another location x_(e), as in the standard algorithm, but then place a new particle at x_(b) with probability

$\max\left( {0,{1 - \frac{r\left( x_{e} \right)}{r\left( x_{b} \right)}}} \right)$ and, independently, possibly another new particle at x_(e) with probability

${\min\left( {1,\frac{r\left( x_{e} \right)}{r\left( x_{b} \right)}} \right)}.$ In this way, in me long run, x_(b) and x_(e) have the right likelihood ratio, and the average number of particles remains constant. Because we don't care that the original particle x_(b) is correlated with the new particles x_(b) and/or x_(e), and because the original particles are already approximately correctly distributed, only a few iterations of this dynamic algorithm are required per time step. This can be achieved in a logarithmic number of iterations, by choosing the jump size to provide annealing, that is, the jump size should be exponentially decaying over the resampling iterations, starting from the largest displacement of the dynamics and going down to the smallest feature size of the dynamics.

9. Discrete Control

There is an analog of the above control algorithm for discrete state spaces. The statement of the discrete problem is t→t+1 x→A(t,x,u) y→B(t,x,u) v→v+C(t,y,u)

where t is the discrete time, x is the discrete hidden state variable, y=m(x) is the discrete observed measurement variable, u is the discrete control variable, and v is the continuous observed scalar cost. Here also, the state dynamics is represented by a stochastic function A that returns a new state from a distribution depending on t, x, u, and the stochastic measurement function is B(t,x,u)=m(A(t,x,u)). We are given a prior probability distribution p(0) of the hidden state x (which must project to a single observation y(0)).

We also impose a terminal cost g(y)≥0 at some possibly infinite time horizon T.

The objective is to choose u to minimize the expectation of the future cost v(T)−v(t)+g(y(T)) from the current time t up to the time horizon T, given that we can only observe y and not x.

To solve this, we will, as in the continuous case, try to express the minimum expected future cost functional ƒ(t, p(t))=E_(p(t))[ƒ(t, x(t))] as the expectation of a single cost function ƒ(t, x(t)) of the hidden state. The backward induction for the cost functional then looks like E _(x(t))[ƒ(t,x(t))]=min_(u(t)) E _(y(t+dt)) └c(t,y(t),u(t))+E _(x(t+1)|y(t+1),u(t))[ƒ(t+1,x(t+1))]┘=min_(u(t)) E _(x(t))[c(t,y(t),u(t))+E _(x(t+1)|y(t+1),u(t))[ƒ(t+1,x(t+1))]]

This equation will hold if the single cost function obeys ƒ(t,x(t))=c(t,y(t),u(t))+E _(x(t+1)|x(t),u(t))[ƒ(t+1,x(t+1))].

The optimization is then to choose u(t) to minimize min_(u(t)) E _(x(t))[ƒ(t,x(t))|u(t)],

where ƒ(t, x(t)) is computed from u(t) by the previous equation.

To make this self consistent, we need to have a unique choice of u(t) for each x(t) and p(t). As before, we will approximate the set of p(t) that need to be considered in the backward induction of the cost functional as being the restrictions of the uninformed distribution p(t,x(t)) to sets of states sharing the same most likely observation path i(t)=y(0) . . . y(t). This makes the informed distributions disjoint and allows us to assign a unique control u(t) to the states x(t) in the support of each disjoint informed distribution p(t)=p_(i(t)). The uninformed distribution p(t,x(t)) propagates forward according to the dynamics x(t+1)|x(t),u(t).

In summary, the semi-local approximation computes a single cost function ƒ(t,x) and an uninformed distribution p(t,x) as follows.

The cost function is computed by backward induction as ƒ(t,x)=c(t,y,u)+E _(x′˜A(t,x,u))[ƒ(t+1,x′)]

where u is chosen for each value of the most likely observation path i to minimize min_(u) E _(x˜p) _(i) [ƒ(t,x)|u]

where p_(i) is the informed distribution corresponding to i.

The uninformed distribution is computed by forward induction as p(t+1,x′)˜(x′˜A(t,x,u)|x˜p(t,x))

and the observational information i is propagated forward as the most likely value of the concatenation i.y at x′ under the dynamics x′˜A(t,x,u).

The informed distributions p_(i) are the uninformed distribution p(t,x) restricted to each distinct value of i.

To turn this into a particle method, we choose a subset of the discrete states x, and for each such state have particle data (x,y,ƒ,p,q,u,i), where ƒ is the value of the single cost function ƒ(t,x), p is the unnormalized weight of the uninformed distribution p(t,x), q is the number of states represented by the particle, and i is the most likely observation path. For efficiency, we will assume that the dynamics A have some kind of locality, to prevent the forward and backward induction steps from becoming quadratic in the number of particles. In the forward sweep, p is propagated forward by distributing the weight across samples of the forward dynamics, and i is propagated forward as most likely values. In the backward sweep, ƒ is propagated backward by averaging over future particles reached by the forward state dynamics, while u is optimized to minimize the resulting ƒ.

To compute emotions as explained in Section 6, we must similarly compute a local square cost function ƒ₂(t, x), so that the variance of the total future cost is E_(p) _(i) [ƒ₂]−(E_(p) _(i) [ƒ])². Since we are averaging the square cost over all future states, the local square cost function is determined by backward induction as ƒ₂(t,x)=C(t,y,u)²+2C(t,y,u)E _(x′˜A(t,x,u))[ƒ(t+dt,x′)]+E _(x′˜A(t,x,u))[ƒ₂(t+dt,x′)].

III. Illustrative System Architecture

In the following description of the various embodiments, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration various embodiments in which the aspects described herein may be practiced. It is to be understood that other embodiments may be utilized and structural and functional modifications may be made without departing from the scope described herein. Aspects are capable of other embodiments and of being practiced or being carried out in various ways. Also, it is to be understood that the phraseology and terminology used herein are for the purpose of description and should not be regarded as limiting. Rather, the phrases and terms used herein are to be given their broadest interpretation and meaning. The use of “including” and “comprising” and variations thereof is meant to encompass the items listed thereafter and equivalents thereof as well as additional items and equivalents thereof. The use of the terms “mounted,” “connected,” “coupled,” “positioned,” “engaged” and similar terms, is meant to include both direct and indirect mounting, connecting, coupling, positioning and engaging.

FIG. 1 illustrates one example of a network architecture and data processing device that may be used to implement one or more illustrative aspects. Various network nodes 103, 105, 107, and 109 may be interconnected via a wide area network (WAN) 101, such as the Internet. Other networks may also or alternatively be used, including private intranets, corporate networks, LANs, wireless networks, personal networks (PAN), and the like. Network 101 is for illustration purposes and may be replaced with fewer or additional computer networks. A local area network (LAN) may have one or more of any known LAN topology and may use one or more of a variety of different protocols, such as Ethernet. Devices 103, 105, 107, 109 and other devices (not shown) may be connected to one or more of the networks via twisted pair wires, coaxial cable, fiber optics, radio waves or other communication media.

The term “network” as used herein and depicted in the drawings refers not only to systems in which remote storage devices are coupled together via one or more communication paths, but also to stand-alone devices that may be coupled, from time to time, to such systems that have storage capability. Consequently, the term “network” includes not only a “physical network” but also a “content network,” which is comprised of the data—attributable to a single entity—which resides across all physical networks.

The components may include computational unit 103, web server 105, and client devices 107, 109. Computational unit 103 may be a general or special-purpose computer or computer farm. Computational unit 103 may be a computational unit that provides overall access, control and administration of databases and control software for performing one or more illustrative aspects described herein. Computational unit 103 may be connected to web server 105 through which users interact with and obtain data as requested. Alternatively, computational unit 103 may act as a web server itself and be directly connected to the Internet. Computational unit 103 may be connected to web server 105 through the network 101 (e.g., the Internet), via direct or indirect connection, or via some other network. Computational unit 103 may have significant ability to run multiple instances of the described method in parallel. Computational unit 103 may also have significant bandwidth for communication of data between multiple instances of described method. Users may interact with the computational unit 103 using remote devices 107, 109, e.g., using a web browser to connect to the computational unit 103 via one or more externally exposed web sites hosted by web server 105. Devices 107, 109 may be used in concert with computational unit 103 to access data stored therein, or may be used for other purposes. For example, from device 107 a user may access web server 105 using an Internet browser, as is known in the art, or by executing a software application that communicates with web server 105 and/or computational unit 103 over a computer network (such as the Internet).

Servers and applications may be combined on the same physical machines, and retain separate virtual or logical addresses, or may reside on separate physical machines. FIG. 1 illustrates just one example of a network architecture that may be used, and those of skill in the art will appreciate that the specific network architecture and data processing devices used may vary, and are secondary to the functionality that they provide, as further described herein. For example, services provided by web server 105 and computational unit 103 may be combined on a single server.

Each component 103, 105, 107, 109 may be any type of known computer, server, or data processing device. Computational unit 103, e.g., may include a processor 111 controlling overall operation of the rate server 103. Computational unit 103 may further include RAM 113, ROM 115, network interface 117, input/output interfaces 119 (e.g., keyboard, mouse, display, printer, etc.), and memory 121. I/O 119 may include a variety of interface units and drives for reading, writing, displaying, and/or printing data or files. Memory 121 may further store operating system software 123 for controlling overall operation of the data processing device 103, control logic 125 for instructing computational unit 103 to perform aspects described herein, and other application software 127 providing secondary, support, and/or other functionality which may or may not be used in conjunction with aspects described herein. The control logic may also be referred to herein as the computational unit software 125. Functionality of the computational unit software may refer to operations or decisions made automatically based on rules coded into the control logic, made manually by a user providing input into the system, and/or a combination of automatic processing based on user input (e.g., queries, data updates, etc.).

Memory 121 may also store data used in performance of one or more aspects described herein, including a first database 129 and a second database 131. In some embodiments, the first database may include the second database (e.g., as a separate table, report, etc.). That is, the information can be stored in a single database, or separated into different logical, virtual, or physical databases, depending on system design. Devices 105, 107, 109 may have similar or different architecture as described with respect to device 103. Those of skill in the art will appreciate that the functionality of data processing device 103 (or device 105, 107, 109) as described herein may be spread across multiple data processing devices, for example, to distribute processing load across multiple computers, to segregate transactions based on geographic location, user access level, quality of service (QoS), etc.

One or more aspects may be embodied in computer-usable or readable data and/or computer-executable instructions, such as in one or more program modules, executed by one or more computers or other devices as described herein. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types when executed by a processor in a computer or other device. The modules may be written in a source code programming language that is subsequently compiled for execution, or may be written in a scripting language such as (but not limited to) HTML or XML. The computer executable instructions may be stored on a computer readable medium such as a hard disk, optical disk, removable storage media, solid state memory, RAM, etc. As will be appreciated by one of skill in the art, the functionality of the program modules may be combined or distributed as desired in various embodiments. In addition, the functionality may be embodied in whole or in part in firmware or hardware equivalents such as integrated circuits, field programmable gate arrays (FPGA), and the like. Particular data structures may be used to more effectively implement one or more aspects described herein, and such data structures are contemplated within the scope of computer executable instructions and computer-usable data described herein.

As described above, the computational unit 103 may perform methods described herein. FIG. 2 illustrates an example user device 200 such as device 107 (shown in FIG. 1) with which a user may access and communicate with computational unit 103. User device 200 and computational unit 103 may be part of the same device or may be separate devices. User device 200 may include a variety of components and modules including a processor 217, random access memory (RAM) 215, read only memory (ROM) 213, memories 201 and 203, which may include one or more collections of data, such as databases, client or server software 205, output adapter 211, input interface 209 and communication interface 207. Processor 217 may include a graphics processing unit (GPU) or a separate GPU may be included in the output adapter 211. Memory 201 may be configured to store electronic data, inclusive of any electronic information disclosed herein. Another memory, such as memory 203, may be configured to store different or overlapping data. In one embodiment, memories 201 and 203 may be a single, non-transitory computer-readable medium. Each memory 201, 203 may or may not include a database to store data or include data stored in RAM memory, accessed as needed by the client/server software. Data associated with the method described may be communicated between user device 200 and a computational unit 103 or a server through a transceiver or network interface, such as communication interface 207.

One or more statutory computer-readable mediums, such as medium 201 or 203 may be configured to contain sensor/server software (graphically shown as software 205). Sensor software 205 may, in one or more arrangements, be configured to identify observational data as well as facilitate or direct communications between two devices, including remote devices 109 and/or communications devices, among other devices. A user may control the device, through input interface 209 using various types of input devices including keyboard 223 and mouse 225. Other types of input devices may include a microphone (e.g., for voice communications over the network), joysticks, motion sensing devices, touchscreens 219 and/or combinations thereof. In one or more arrangements, music or other audio such as speech may be included as part of the user experience with the device. Further collection of observational data may be facilitated through cameras, GPS, accelerometers, chemical detectors, or any other such input structures that may aid in gathering observational data. In such instances, the audio may be outputted through speaker 221. Further, this observational data may be limited to a virtual world. In such embodiments, observational data may be produced and inputted via computers or other computational units. Such observational worlds may include, but are not limited to, video games and simulator programs. In such embodiments, observational data may contain virtual data, such as virtual chemical compositions and virtual acceleration. Such observational data may include instead or in addition to virtual sensory data, data regarding the state of a computational device which runs, compiles, or outputs such described virtual world. Data regarding the state of a computational device may include but is not limited to the amount of RAM/ROM currently being used, battery life, or the progression of a program.

In some embodiments, the actions dictated by the method described may be performed by actuators 230. These actuators 230 may comprise any structure or separate device which outputs directions to perform an action to a user or itself performs some of or all of the action dictated by the method described. Such actuators 230 may include, but are not limited to, various machines such as automobiles or computers, appliances such as alarm clocks or washing machines, and robotic or artificially intelligent entities such as automated personal assistants. Such actuators 230 may be physically a part of user device 200 or computational unit (such as 103 shown in FIG. 1). Actuators 230 may also interact with user device 200 or computational unit 103 through a network (such as 101 shown in FIG. 1). Actuator 230 may provide instructions and possible outcomes of directed actions to a user through an output device. Actuator 230 may also express emotions to the user indicating how a course of action may emotionally affect the user. Such emotion may be expressed through facial structure of a virtual face or through the tone of a virtual voice providing instructions to the user. Actuator 230 also may be used to perform specific tasks in order to achieve a goal which may be inputted into the method described. In a real-world setting, actuator 230 may perform any of a myriad of tasks including but not limited to decelerating a vehicle if its driver is emotionally distraught, closing the windows of a dwelling if a new pet seems particularly adventuresome, or collecting a user's favorite foods before a user is hungry in order to avoid traffic later. In a virtual setting, actuators 230, may perform any actions that an actuator may in a real-world setting. Also, an actuator 230 may be a virtual character in a game or simulation which performs actions or expresses emotion dictated by the method described.

Software 205, computer executable instructions, and other data used by processor 217 and other components of user device 200 may be stored in memories, 201, 203, RAM 215, ROM 213 or a combination thereof. Other types of memory may also be used, including both volatile and nonvolatile memory. Software 205 may be stored within RAM 215, ROM 213 and/or memories 201 and 203 to provide instructions to processor 217 such that when the instructions are executed, processor 217, device 200 and/or other components thereof are caused to perform functions and methods described herein. In one example, instructions for generating a user interface for interfacing with a server 105 or user device 107 may be stored in RAM 215, ROM 213 and/or databases 201 and 203. Software 205 may include both applications and operating system software, and may include code segments, instructions, applets, pre-compiled code, compiled code, computer programs, program modules, engines, program logic, and combinations thereof. Computer executable instructions and data may further be stored on some physical form of computer readable storage media (referred to herein as “computer memory”) including, e.g., electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, DVD or other optical disk storage, magnetic cassettes, magnetic tape, magnetic storage and the like. Software 205 may operate to accept and process observational data so that it may be used by the method described. There may also be software 205 that relays actions dictated by the method to the user. In some cases such software 205 may produce a text or voice list of instructions. Also, software 205 may allow an actuator to perform an action dictated by the method.

FIG. 3 shows a general view of possible communication between a user device 301 and the computational unit 303 which performs the method described. In the shown embodiment, the user device 301 contains the input structures as well as the actuators. As described above, however, such a user device 301 need not contain all those elements. As shown in FIG. 3, the user device 301 relays observational data 304 to the computational unit 303. A user may also input a goal 307 to be achieved into the user device to be relayed to the computational unit 303. Such a goal 307 may be a high-level goal including not being hungry while simultaneously not gaining weight, not wasting any food, and not spending over $300 a month on food. The described observational data 304 and goals 307 may be communicated to the computational unit 30 through any of various methods of communication exemplified in the above description of FIG. 1. Using that observational data 304 and goals 307, the computational unit performs the described particle method in order to determine optimal actions 305 to achieve goal 307. Computational unit 303 may also determine emotions 309 associated with the optimal actions 305. Such optimal actions 305 and/or emotions 309 are then outputted to an actuator, here associated with the user device, 301. The actuator may then display instructions according to the optimal actions 305 and/or emotions 309 or perform the optimal actions itself.

The computational unit 303 may perform sparse neural control methods (or alternatively, particle methods) as described herein. FIG. 4 provides a general view of a sparse neural control method 400. A sparse neural control method 400 begins with the step of inputting the observational data and high level goals 401. The observational data may include observed states of the world, represented as a set of vectors in the computational unit (not shown), including: a vector u, representing the instructions to the actuators for actions to be taken; a vector c, representing the current cost, such that the high-level goal of the system is to minimize the total cost over time; and a vector y, representing all the other observable data at the current time. There may also be a known final cost c_(∞) at the final time. As stated above, this world may be real or virtual. The computational unit may also encode a model of how the world works, in the form of a filter comprising a sparse network. The input of the filter may be the observational data (y, c, u), and its output may be the uncertainty about the state of the world, in the format of a sparse set of probabilities p(x) of a plurality of high-level explanations x of the world (sparse meaning that most of the probabilities are zero). The goal of the sparse neural control method is to determine actions that achieve the specified goal while minimizing the total expected future cost. The output of the sparse neural control method may also include macroscopic statistics of the control problem, such as the expected future cost and the variance of future cost, which can be used to compute emotions.

The aforementioned filter may be trained from the observational data by means of supervised or unsupervised learning techniques known to those with skill in the art. Whatever the details of the chosen filter, in order to apply the sparse neural control method, we only need to know three functions determined by the filter: its feed-forward function X(x, u) that predicts a sparse future distribution of high-level explanations, given, among other inputs, a current explanation x and a current proposed action u; its feedback function C(x, u) that predicts the future cost, with the same inputs; and its feedback function I(x, u) that predicts the future observational data, with the same inputs.

The overall operation of the sparse neural control method may include a set of preparation steps followed by a simulation loop. The set of preparation steps take the new observational data, and create an initial sparse distribution of high-level explanations consistent with this observation and representing any uncertainty about the unknown state of the world. This may be obtained from the filter, trained as described above. The result of the preparation step is a new sparse distribution p(x). In such an embodiment, as shown in FIG. 4, the set of preparation steps proceeds as follows: observational data, including costs and actions, are inputted into the computational unit in step 401, the computational unit then applies the filter to determine the initial unconditional uncertainty p(x) and the initial archetype i(x) in step 403, the computational unit then performs a forward sweep in step 407. In the set of preparation steps, the computational unit skips the convergence step of the sparse neural control method and continues to step 411 in which it determines the final cost function ƒ(x) and final squared cost function ƒ₂ (x) using the final cost c_(∞). Once the set of preparation steps have been completed, the computational unit performs the simulation loop.

During the simulation loop, the computational unit repeats a sequence of four steps until convergence is achieved: computing the final ƒ, ƒ₂ in step 411, backward sweep in step 413, computing the initial p, i in step 405, and forward sweep in step 407. The loop breaks and returns the calculated optimal actions and emotions in step 415 once convergence is achieved in step 409. The computational unit may determine convergence when values of ƒ, ƒ₂, and u are no longer changing after the backward sweep, and the values of p and i are no longer changing after the forward sweep. The backward and forward sweep steps will be explained in more detail below. The computation of the final values uses the optional final cost to initialize the values of ƒ and ƒ₂. The computation of initial values uses the initial uncertainty from the preparation step to initialize the values of p and i. During this entire computation, due to the sparseness of the filter, only values of the functions p, i, ƒ, ƒ₂ on a small set of all the possible high-level explanations x need to be maintained.

The computational device may compute emotions as macroscopic statistics of the control problem. The expected future cost ƒ leads to a happy emotion if the value is low, and a sad emotion if the value is high. The variance of future cost (i.e., the expectation of ƒ₂−ƒ²), leads to a tense emotion if the value is high, and a calm emotion if the value is low. Happy tension may be expressed as an excited emotion, while sad tension may be expressed as a fear emotion. The determined optimal actions and/or emotions are outputted to an actuator in step 415.

FIG. 5 describes an illustrative embodiment of the backward sweep in more detail. The computational unit may perform the backward sweep as a parallel method in which each of the sparse set of possible explanations x, in one embodiment, may be run in a separate processing unit, with some communication between processing units. FIG. 5 specifically exemplifies the backward sweep with two possible explanations. The structure of the computation may extend to any number of possible explanations in the same way. Overall, the backward sweep generally may be described as a loop that runs backward in time from the final time to the initial time in discrete time steps dt<0.

For each iteration of the loop, the computational unit may perform a number of steps. In FIG. 5 the backward sweep begins when time is final, as shown in step 500. The computational unit may use information (501 a and 501 b) about each explanation, and apply backward time dynamics to each possible explanation in steps 505 a and 505 b. Because each possible explanation carries values of the functions detailed above, the application of those dynamics changes those function values in the following way from time t+1 back to time t: ƒ_(t)(x|u)=C(x,u)+E _(X(x,u)(x′))[ƒ_(t+1)(x′)].

In step 503, the computational unit allows possible explanations that are linked via the sparse distribution X(x, u) to communicate to each other information about their values of ƒ, ƒ₂. This communication does not require any predetermined structure on the set of explanations, but may instead use unstructured spatial sorting of the explanations x, for example by means of decision trees.

In step 507, the computational unit aggregates expectations for each value of the archetype i. In a preferred embodiment the expectations computed are E _(p) _(i) _((x)) E _(X) _(u) _((x,u)(x′))[ƒ_(t+1)(x′)], E _(p) _(i) _((x))[C _(u)(x,u)].

The probabilities p_(i)(x) used in computing the expectation are the values of the unconditional uncertainty p(x) restricted to explanations x that share the chosen archetype i. This aggregation only requires the computational unit to provide communication between explanations x with the same value of i, which can be accomplished in using unstructured spatial sorting of the archetypes i, for example by means of decision trees.

In steps 509 a and 509 b, the computational unit determines a candidate for optimal action by means of the control equation: u=(E _(p) _(i) _((x))[C _(u)(x,u)])⁻¹(E _(p) _(i) _((x)) E _(X) _(u) _((x,u)(x′))[ƒ_(t+1)(x′)]).

The equation is calculated in terms of the expectation computed by the aggregation step. For stability, it may be necessary for the computational unit to average the right hand side of the control equation with a certain amount of the previous value of the action u. Also, for convergence, it may be necessary for the computational unit to repeat the aggregation and control steps a number of times until the new value of u is no longer changing.

In step 511, the computational unit determines whether the time equals the initial time. If so, the computational unit closes the loop in step 515 and determines the initial values of p and i as shown in step 405 of FIG. 4. If not, the computational unit proceeds to steps 513 a and 513 b in which the computational unit determines the possible explanations in order to again perform backward dynamics in steps 501 a and 501 b.

After the completion of the backward sweep, the computational unit determines the initial values of p and i as shown in step 405 of FIG. 4. The computational unit may perform the forward sweep as a parallel method in which each of the sparse set of possible explanations x, in one embodiment, may be run in a separate processing unit, with some communication between processing units. FIG. 6 illustrates the forward sweep with two possible explanations as an example. The structure of the computation may extend to any number of possible explanations in the same way. Overall, the forward sweep generally may be described as a loop that runs forward in time from the initial time to the final time in discrete time steps dt>0.

For each iteration of the loop, the computational unit may perform a number of steps. In FIG. 6 the forward sweep begins when time is initial, as shown in step 600. Then computational unit may use information about each explanation (601 a and 601 b), and apply forward time dynamics to each explanation in steps 605 a and 605 b. Because each possible explanation carries values of the functions detailed above, the application of those dynamics changes those function values in the following way from time t forward to time t+1: determining p_(t+1)(x′) as the convolution of p_(t)(x) with the sparse distribution X(x, u)(x′), and the archetype i_(t+1)(x′) as the most likely future archetype I(x, u) for x′ at time t+1, based on the sparse probabilities X(x, u)(x′).

In step 603, the computational unit allows possible explanations that are linked via the sparse distribution X(x, u) to communicate to each other information about their values of p, i. This communication does not require any predetermined structure on the set of possible explanations, but may instead use unstructured spatial sorting of the explanations x, for example by means of decision trees.

In step 607, the computational unit determines whether the time equals the initial time. If so, the computational unit closes the loop in step 609 and determines whether the optimal actions converge as shown in step 409 of FIG. 4. If not, the computational unit proceeds to steps 611 a and 611 b in which the computational unit determines the new set of possible explanations in order to again perform forward dynamics in steps 601 a and 601 b.

As stated in the description of FIG. 4, above, after the forward sweep, the computational unit determines whether the candidates of the optimal action converge. If so, the optimal actions and/or emotions are outputted in step 415. If not, the computational unit proceeds to step 411, in which it determines the final values of ƒ, ƒ₂ and performs another backwards sweep, step 413.

IV. Illustrative Use Case Scenario

The components of the described sparse neural control method will now be explained in an example of a personal assistant. In this example, this personal assistant may be specifically concerned with helping the user satisfy his or her need for food.

The device configuration may include the user's own commodity smartphone as the user device, and a remote server farm maintained by a service provider as the computational unit. These two may communicate over the wireless and wired Internet. To sign up, the user may install an application onto the smartphone that collects observational data from the smartphone's built in sensors, such as GPS (location), clock (time), camera (visual input), microphone (acoustic input), keyboard (text input), and readable custom data from other applications. The application may also effect actions and express emotions using the smartphone's built in actuators, such as display (visual output), speaker (acoustic output), vibration (kinetic output), and writeable custom data to other applications. This application may collect time, location, purchase information (from a payment application on the smartphone), information on food store location and hours (via custom data retrieved from mapping applications on the smartphone), and user commands (via keyboard or speech-to-text). This application may provide the user with recommended actions either visually or acoustically; visually, the application may display text, maps, and emotion icons; acoustically, the application may use text-to-speech to state recommended actions, with different tones of voice to indicate different emotions.

The basic variables in the algorithm represent the following:

t=clock time;

y=what is known and observed about the state of the world, such as potentially the amount, location, and freshness of food available from various sources (home, store, or on person); whether or not each store is open; the hunger level of the user; what food the user has purchased or eaten, etc.;

x=possible high-level explanations of the observations, such as patterns that have been learned about food spoiling, that the store opens and closes on a given schedule, that other people might have eaten food from the refrigerator at home, etc.;

u=actions the user can take, such as going to different locations (home, store); buying, storing, or eating food.

The basic model functions described in Section III represent the following:

X=mechanics and randomness of the world: this includes the fact that hunger increases over time until the user eats, that the user can move from location to location and carry food, that food spoils if not properly stored, that eating spoiled food causes sickness, that food in stores can only be carried if the store is open and the user purchases the food, etc.; yet also that the rate of increase of hunger and rate of food spoilage cannot be predicted exactly; stores may be unexpectedly closed despite posted hours; movement from location to location could be slowed due to weather; traffic; etc.;

C=high-level goals are determined by assigning incremental costs: to being hungry, in proportion to the level of hunger, eventually resulting in a very high cost for starvation; to exerting effort to travel from location to location; to paying money; to being sick.

The computational unit may then simulate a multiplicity of explanations x, each consistent with what is known now, weighted with probabilities p which are updated as each observation comes in. As such, one possible explanation may correspond to the story that traffic beyond the next corner is at a standstill and rain will fall in five minutes. Another possible explanation may correspond to the story that traffic beyond the next corner moves quickly and there will be no rain for the next hour.

The computational unit then may perform a series of backward and forward sweeps in order to achieve an optimal action to relay to the user device. During the backward sweep, the computational unit may assume a terminal time associated with a terminal cost. The computational unit may hold constant those variables that propagate forward with time and determine an optimal action based on the way that the backward propagating variables change as time moves backward. The computational unit then may hold constant those variables that propagate backward with time and determine an optimal action based on the way that the forward propagating variables change as time moves forward. The process continues until the optimal action determined by the backward sweep converges with the optimal action determined by the forward sweep.

After completing the sparse neural control method (or alternatively, after completing the particle method also discussed above), the computational unit may relay the recommended action u to the user device. The user device may provide a recommended action u, either by text on the display or by text-to-speech through the speaker. This recommended action could consist of avoiding turning on the next corner because traffic likely will be at a standstill and rain may fall.

Coupled with the determination of an optimal action may be a determination of an emotion associated with a particular action. The computational unit may determine that a particular action will likely result in a particular emotion. The computational unit may determine these emotions using the variance of an expected future cost, given by the expectation of ƒ₂(t)−ƒ² (t), where ƒ₂ denotes the expectation of the square of the difference of future cost and present cost. A low expectation may result is a happy emotion; while a high expectation may result in a sad emotion. The level of variance may affect the level of excitement or calm the user might feel. The device may also express said emotions based on ƒ and ƒ₂, either by displaying an icon of a face expressing the emotion on the display, or by altering the tone of voice of the text-to-speech module.

Moreover, the optimal action and/or emotions determined by the described method may provide not only immediate recommendations, but an entire strategy, complete with hypothetical scenarios. This strategy may develop in the form of recommended actions u at future times depending on the projected archteype i. For example, the device could tell the user ahead of time that if the first store is unexpectedly closed, the next step in the plan is to go to a different specified store.

The strategies determined by this method may plan ahead to achieve long-term goals. For example, if the user is not hungry at a present time, but the stores will close soon, the algorithm may still recommend that the user go to the store, buy food, go home, store the food, and then retrieve and eat the food at home later when the inevitable hunger comes.

The strategies may take these uncertainties into account. For example, if there are three stores with equal probabilities of having food in stock and equal distances from home, but two are close to each other, the method may recommend going to the close pair because that may allow increased probability of obtaining food with little additional effort, by potentially trying both stores of the pair.

The strategies may be flexibly adapted in real-time in response to events. For example, if the user is on the way to a particular store based on a recommendation from the algorithm, and mapping data indicate that the road has suddenly been closed due to an accident, the algorithm may recompute the strategy and divert the user to the closest store that does not use that road. The user may receive recommended actions until a goal, such as satisfying a user's need for food is achieved.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. 

What is claimed is:
 1. A method comprising: receiving a plurality of current observations about a real or simulated world, wherein each of the current observations is received from a different one of a plurality of different types of physical sensors; maintaining, by a computational unit, an objective; representing the objective using an incremental cost of a plurality of potential actions; maintaining, by the computational unit, a current uncertainty about an unknown state of a world, wherein the current uncertainty is represented by one or more probabilities of a plurality of high-level explanations of the world, such that a set of possible explanations at any one time is sparse, and wherein the current uncertainty is updated from the plurality of current observations using a filter comprising a sparse network; determining, by the computational unit, one or more optimal actions to achieve the objective with an optimized expected total future cost, wherein said determining comprises performing both backward induction on the optimized expected total future cost and forward induction on the current uncertainty about the unknown state of the world; and performing, by a physical actuator, the one or more optimal actions.
 2. The method of claim 1, wherein the filter comprises a neural network.
 3. The method of claim 1, wherein the filter comprises sparse coding.
 4. The method of claim 1, wherein the filter also comprises a stickiness penalty that penalizes changes in resulting possible high-level explanations over time.
 5. The method of claim 4, wherein the stickiness penalty linearly penalizes absolute values of the changes, thereby giving preference to locally constant possible explanations with occasional jumps.
 6. The method of claim 1, further comprising: determining a first number t, which represents a future time; determining a first vector x, which represents a possible explanation at time t; determining a second vector u, which represents a potential action at time t; determining a sequence of vectors i, called an archetype, which represents a preferred history of observations from a current time up to time t, consistent with explanation x; determining a first function ƒ(t, x), called a local objective function; and determining a first sparse probability distribution p(t, x), called unconditional uncertainty, which represents an uncertainty of a plurality of explanations x of the world at time t, unconditional on future observations, wherein said forward and backward induction comprises: restricting a set of future uncertainties conditional on observations that need to be considered as probability distributions of form p_(i)(t, x), which comprises a restriction of the unconditional uncertainty p(t, x) to explanations x having the same archetype i at time t; representing an expected objective value at time t with archetype i as E_(p) _(i) [ƒ], where operator E[ ] represents an expectation of a function with respect to a probability distribution; determining the local objective function ƒ by backward induction; determining the unconditional uncertainty p and the archetype i by forward induction; and determining optimal actions u for each archetype i and time t.
 7. The method of claim 6, wherein said forward and backward induction further comprises: applying the filter, given a current explanation x_(t) and proposed action u_(t), to predict a sparse distribution X(x_(t), u_(t)) of possible explanations at a next time t+1, along with a predicted incremental objective C(x_(t), u_(t)) and a predicted archetype I(x_(t), u_(t)); determining the backward induction by propagating the local objective function back in time as ƒ_(t)(x_(t)|u_(t))=C(x_(t), u_(t))+E_(X(x) _(t) _(,u) _(t) _()(x))[ƒ_(t+1)(x)], where u_(t) is chosen to optimize an expected objective value E_(p_(t,)i_(t)(x_(t)))[f_(t)(x_(t)|u_(t))],  which happens where u_(t) = (E_(p_(t), i_(t)(x_(t)))[C_(u)(x_(t), u_(t))])⁻¹(−E_(p_(t,)i_(t)(x_(t)))E_(X_(u)(x_(t), u_(t))(x))[f_(t + 1)(x)]);  and determining the forward induction by propagating the unconditional uncertainty p_(t+1)(x_(t+1)) forward in time as a convolution of p_(t)(x_(t)) with probabilities X(x_(t), u_(t))(x), and an archetype i_(t+1)(x_(t+1)) as a most likely future archetype I(x_(t), u_(t)) for x at time t+1, based on the probabilities X(x_(t), u_(t))(x).
 8. A system comprising: a physical actuator; a plurality of physical sensors; a processor; and memory storing computer readable instructions that, when executed by the processor, configure the system to perform: receiving, by the plurality of physical sensors, a current observation about a real or simulated world; maintaining, by a computational unit, an objective; representing the objective using an incremental cost of a plurality of potential actions; maintaining, by the computational unit, a current uncertainty about an unknown state of a world, wherein the current uncertainty is represented by one or more probabilities of a plurality of high-level explanations of the world, such that a set of possible explanations at any one time is sparse, and wherein the current uncertainty is updated from the current observation using a filter comprising a sparse network; determining, by the computational unit, one or more optimal actions to achieve the objective with an optimized expected total future cost, wherein said determining comprises performing both backward induction on the optimized expected total future cost and forward induction on the current uncertainty about the unknown state of the world; and causing the physical actuator to perform the one or more optimal actions.
 9. The system of claim 8, wherein the filter comprises a neural network.
 10. The system of claim 8, wherein the filter comprises sparse coding.
 11. The system of claim 8, wherein the filter also comprises a stickiness penalty that penalizes changes in resulting possible high-level explanations over time.
 12. The system of claim 11, wherein the stickiness penalty linearly penalizes absolute values of the changes, thereby giving preference to locally constant possible explanations with occasional jumps.
 13. The system of claim 8, wherein the memory storing computer readable instructions, when executed by the processor, further configure the system to perform: determining a first number t, which represents a future time; determining a first vector x, which represents a possible explanation at time t; determining a second vector u, which represents a potential action at time t; determining a sequence of vectors i, called an archetype, which represents a preferred history of observations from a current time up to time t, consistent with explanation x; determining a first function ƒ(t, x), called a local objective function; and determining a first sparse probability distribution p(t, x), called unconditional uncertainty, which represents an uncertainty of a plurality of explanations x of the world at time t, unconditional on future observations, wherein said forward and backward induction comprises: restricting a set of future uncertainties conditional on observations that need to be considered as probability distributions of form p_(i)(t, x), which comprises a restriction of the unconditional uncertainty p(t, x) to explanations x having the same archetype i at time t; representing an expected objective value at time t with archetype i as E_(p) _(i) [ƒ], where operator E[ ] represents an expectation of a function with respect to a probability distribution; determining the local objective function ƒ by backward induction; determining the unconditional uncertainty p and the archetype i by forward induction; and determining optimal actions u for each archetype i and time t.
 14. The system of claim 13, wherein said forward and backward induction further comprises: applying the filter, given a current explanation x_(t) and proposed action u_(t), to predict a sparse distribution X(x_(t), u_(t)) of possible explanations at a next time t+1, along with a predicted incremental objective C(x_(t), u_(t)) and a predicted archetype I(x_(t), u_(t)); determining the backward induction by propagating the local objective function back in time as ƒ_(t)(x_(t)|u_(t))=C(x_(t), u_(t))+E_(X(x) _(t) _(,u) _(t) _()(x))[ƒ_(t+1)(x)], where u_(t) is chosen to optimize an expected objective value E_(p_(t,)i_(t)(x_(t)))[f_(t)(x_(t)|u_(t))],  which happens where u_(t) = (E_(p_(t), i_(t)(x_(t)))[C_(u)(x_(t), u_(t))])⁻¹(−E_(p_(t,)i_(t)(x_(t)))E_(X_(u)(x_(t), u_(t))(x))[f_(t + 1)(x)]);  and determining the forward induction by propagating the unconditional uncertainty p_(t+1)(x_(t+1)) forward in time as a convolution of p_(t)(x_(t)) with probabilities X(x_(t), u_(t))(x), and an archetype i_(t+1)(x_(t+1)) as a most likely future archetype I(x_(t), u_(t)) for x at time t+1, based on the probabilities X(x_(t), u_(t))(x).
 15. One or more non-transitory computer readable media comprising computer readable instructions stored thereon, wherein when the instructions are executed by a data processing system, said instructions configure the data processing system to perform: receiving, by a plurality of physical sensors, a plurality of observations about a real or simulated world; maintaining, by a computational unit, an objective; representing the objective using an incremental cost of a plurality of potential actions; maintaining, by the computational unit, a current uncertainty about an unknown state of a world, wherein the current uncertainty is represented by one or more probabilities of a plurality of high-level explanations of the world, such that a set of possible explanations at any one time is sparse, and wherein the current uncertainty is updated from the plurality of observations using a filter comprising a sparse network; determining, by the computational unit, one or more optimal actions to achieve the objective with an optimized expected total future cost, wherein said determining comprises performing both backward induction on the optimized expected total future cost and forward induction on the current uncertainty about the unknown state of the world; causing a physical actuator to output instructions for performing the one or more optimal actions.
 16. The one or more non-transitory computer readable media of claim 15, wherein the filter comprises a neural network.
 17. The one or more non-transitory computer readable media of claim 15, wherein the filter comprises sparse coding.
 18. The one or more non-transitory computer readable media of claim 15, wherein the filter comprises one or more Boltzmann machines.
 19. The one or more non-transitory computer readable media of claim 15, wherein the filter also comprises a stickiness penalty that penalizes changes in resulting possible high-level explanations over time.
 20. The one or more non-transitory computer readable media of claim 19, wherein the stickiness penalty linearly penalizes absolute values of the changes, thereby giving preference to locally constant possible explanations with occasional jumps.
 21. The one or more non-transitory computer readable media of claim 15, wherein when the instructions are executed by a data processing system, said instructions configure the data processing system to further perform: determining a first number t, which represents a future time; determining a first vector x, which represents a possible explanation at time t; determining a second vector u, which represents a potential action at time t; determining a sequence of vectors i, called an archetype, which represents a preferred history of observations from a current time up to time t, consistent with explanation x; determining a first function ƒ(t, x), called a local objective function; and determining a first sparse probability distribution p(t, x), called unconditional uncertainty, which represents an uncertainty of a plurality of explanations x of the world at time t, unconditional on future observations, wherein said forward and backward induction comprises: restricting a set of future uncertainties conditional on observations that need to be considered as probability distributions of form p_(i)(t, x), which comprises a restriction of the unconditional uncertainty p(t, x) to explanations x having the same archetype i at time t; representing an expected objective value at time t with archetype i as E_(p) _(i) [ƒ], where operator E[ ] represents an expectation of a function with respect to a probability distribution; determining the local objective function ƒ by backward induction; determining the unconditional uncertainty p and the archetype i by forward induction; and determining optimal actions u for each archetype i and time t.
 22. The one or more non-transitory computer readable media of claim 21, wherein said forward and backward induction further comprises: applying the filter, given a current explanation x_(t) and proposed action u_(t), to predict a sparse distribution X(x_(t), u_(t)) of possible explanations at a next time t+1, along with a predicted incremental objective C(x_(t), u_(t)) and a predicted archetype I(x_(t), u_(t)); determining the backward induction by propagating the local objective function back in time as ƒ_(t)(x_(t)|u_(t))=C(x_(t), u_(t))+E_(X(x) _(t) _(,u) _(t) _()(x))[ƒ_(t+1)(x)], where u_(t) is chosen to optimize an expected objective value E_(p_(t), i_(t)(x_(t)))[f_(t)(x_(t)|u_(t))],  which happens where u_(t) = (E_(p_(t, i_(t))(x_(t)))[C_(u)(x_(t), u_(t))])⁻¹(−E_(p_(t), i_(t)(x_(t)))E_(X_(u)(x_(t), u_(t))(x))[f_(t + 1)(x)]);  and determining the forward induction by propagating the unconditional uncertainty p_(t+1)(x_(t+1)) forward in time as a convolution of p_(t)(x_(t)) with probabilities X(x_(t), u_(t))(x), and an archetype i_(t+1)(x_(t+1)) as a most likely future archetype I(x_(t), u_(t)) for x at time t+1, based on the probabilities X(x_(t), u_(t))(x).
 23. The method of claim 1, wherein the performing the one or more optimal actions comprises communicating, by the computational unit and the actuator, via a network.
 24. The system of claim 8, wherein the physical actuator comprises an automated personal assistant. 